home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 2 / Geek_Gadgets_2_2352.bin / lists / ade-gcc.archive.9602.gz / ade-gcc.archive.9602 / 000032_owner-ade-gcc_Mon Feb 12 08:07:48 1996.msg < prev    next >
Internet Message Format  |  1996-02-28  |  3KB

  1. Return-Path: <owner-ade-gcc>
  2. Received: by fishpond (Smail3.1.29.1 #57)
  3.     id m0tlxys-000gXda; Mon, 12 Feb 96 08:07 EST
  4. Sender: owner-ade-gcc
  5. Received: from oersted.gbar.dtu.dk by fishpond with smtp
  6.     (Smail3.1.29.1 #57) id m0tlxym-000gXUC; Mon, 12 Feb 96 08:07 EST
  7. Received: (from c948374@localhost) by oersted.gbar.dtu.dk (8.7.3/8.7.3) id OAA11060; Mon, 12 Feb 1996 14:06:34 +0100 (MET)
  8. Date: Mon, 12 Feb 1996 14:06:33 +0100 (MET)
  9. From: Rask Ingemann Lambertsen <c948374@student.dtu.dk>
  10. To: amiga-gcc-port@nic.funet.fi, ade-gcc@amigalib.com
  11. Subject: Passing function arguments in registers
  12. Message-ID: <Pine.HPP.3.91.960212140231.3858C-100000@oersted.gbar.dtu.dk>
  13. MIME-Version: 1.0
  14. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  15. Content-Transfer-Encoding: quoted-printable
  16. Sender: owner-ade-gcc@amigalib.com
  17. Precedence: bulk
  18.  
  19. Hi,
  20.  
  21. Following the discussion on amiga-gcc-port of whether or not it is a
  22. good to pass arguments in registers when making function calls, I decided
  23. to see what the GCC documentation had to say about that. From gcc.guide,
  24. "Interfacing to GCC output":
  25.  
  26.    "   GNU CC uses the system's standard convention for passing arguments.
  27.    On some machines, the first few arguments are passed in registers; in
  28.    others, all are passed on the stack.  It would be possible to use
  29.    registers for argument passing on any machine, and this would probably
  30.    result in a significant speedup.  But the result would be complete
  31.    incompatibility with code that follows the standard convention.  So th=
  32. is
  33.    change is practical only if you are switching to GNU CC as the sole C
  34.    compiler for the system.  We may implement register argument passing o=
  35. n
  36.    certain machines once we have a complete GNU system so that we can
  37.    compile the libraries with GNU CC."
  38.  
  39. To me, it makes three things clear:
  40. 1) Passing arguments in registers *does* provide a speedup and *is* an
  41.    advantage.
  42. 2) It causes incompatibility with existing link libraries.
  43. 3) GCC already has support for passing arguments in registers. We just
  44.    have to utilitze it.
  45.  
  46.    Since I don't use link libraries in my programmes, I don't see any
  47. problems at all. But to shut up those people who *do* see the world comin=
  48. g
  49. to an end (sorry) because of this, I suggest making a command line switch
  50. to choose between the different argument passing conventions.
  51.  
  52.    Since it is my impression that ADE is more Amiga-focused than the=20
  53. people on amiga-gcc-port, I'd also like to know what the ADE people think=
  54. =20
  55. about it.
  56.  
  57. Regards,
  58.  
  59. /=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
  60. =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
  61. =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF\
  62. | Rask Ingemann Lambertsen       | E-mail: c948374@student.dtu.dk        =
  63. |
  64. | Amiga GNU CC README maintainer | WWW: http://www.gbar.dtu.dk/~c948374/ =
  65. |
  66. | Keyboard error: <Ctrl> and <Alt> are stuck - press <Del> to continue   =
  67. |